// pages/index/hospital/hospital.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    local: '选择地区',
    department: '评分',
    screen: '筛选',
    i: 0,
    screens: ['一级医院甲等', '一级医院乙等', '一级医院丙等', '二级医院甲等', '二级医院乙等', '二级医院丙等', '三级医院特等', '三级医院甲等', '三级医院乙等', '三级医院丙等'],
    departments: ['4-5', '3-4', '2-3', '1-2'],
    lists:[
      {
        name:'山西大医院',
        img:'/assets/images/wei.jpg',
        grade:'一级医院甲等',
        type:'综合医院',
        score:'5',
        amount:'5000',
        situation:'自有',
        distance:'111',
        branch:'10'
      },
      {
        name: '山西大医院',
        img: '/assets/images/wei.jpg',
        grade: '一级医院甲等',
        type: '综合医院',
        score: '5',
        amount: '5000',
        situation: '自有',
        distance: '111',
        branch: '10'
      },
      {
        name: '山西大医院',
        img: '/assets/images/wei.jpg',
        grade: '一级医院甲等',
        type: '综合医院',
        score: '5',
        amount: '5000',
        situation: '自有',
        distance: '111',
        branch: '10'
      },
      {
        name: '山西大医院',
        img: '/assets/images/wei.jpg',
        grade: '一级医院甲等',
        type: '综合医院',
        score: '5',
        amount: '5000',
        situation: '自有',
        distance: '111',
        branch: '10'
      }
    ]
  },
  option: function (e) {
    let that = this;
    console.log(e)
    let a = e.currentTarget.dataset.id;
    that.setData({
      i: a
    })
  },
  bindRegionChange: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    this.setData({
      local: e.detail.value[2]
    })
  },
  bindRegionChange2: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    let that = this;
    let a = e.detail.value;
    let b = that.data.departments[a];
    that.setData({
      department: b
    })
  },
  bindRegionChange4: function (e) {
    console.log('picker发送选择改变，携带值为', e.detail.value)
    let that = this;
    let a = e.detail.value;
    let b = that.data.screens[a];
    this.setData({
      screen: b
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function() {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  }
})